package com.woniuxy.dudugua.service.impl;

import com.woniuxy.dudugua.entity.Category;
import com.woniuxy.dudugua.mapper.CategoryMapper;
import com.woniuxy.dudugua.mapper.ProductMapper;
import com.woniuxy.dudugua.service.MajorService;
import com.woniuxy.dudugua.util.view.OverseasView;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class MajorServiceImpl  implements MajorService {
    @Resource
    private ProductMapper productMapper;
    @Resource
    private CategoryMapper categoryMapper;
    @Override
    public List<OverseasView> selectByProductMajor() throws Exception {
        List<OverseasView> major = productMapper.selectByProductMajor();
        if(major!=null){
            return major;
        }
        return null;
    }

    @Override
    public List<Category> selectByProductMajorIdSon() throws Exception {
        List<Category> majorIdSon = categoryMapper.selectByProductMajorIdSon();
        if(majorIdSon!=null){
            return majorIdSon;
        }
        return null;
    }
}
